using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TouchInputManager.Tests
{
    public class TouchInteractableObjSubScene : TouchInteractableObj
    {
        public RTTSubSceneCtr subSceneCtr;

        private StructureDisperseAnimPlayer animPlayer;

        void Start()
        {
            enableDoubleFocusSet = true;
            enableLongPressFocusSet = true;
        }

        public override void InteractLongPressFocusSet(RaycastHit hit)
        {
            base.InteractLongPressFocusSet(hit);

            animPlayer = GetComponent<StructureDisperseAnimPlayer>();

            subSceneCtr.isDisperse = !subSceneCtr.isDisperse;

            if (subSceneCtr.isDisperse)
            {
                StartCoroutine(animPlayer.PlayDisperseEffect());
            }
            else
            {
                StartCoroutine(animPlayer.PlayMergeEffect());
            }
        }
    }
}

